package s47.dqj.dao;

import java.util.ArrayList;
import java.util.List;

import javax.annotation.Resource;

import org.hibernate.Query;
import org.hibernate.SessionFactory;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;

import s47.dqj.bean.DepartmentPositionCost;

/**
 * 4.科室职位挂号费用表
 * @author Administrator
 *
 */
@Repository("departmentPositionCostDaoImpl")
public class DepartmentPositionCostDaoImpl extends HibernateDaoSupport implements DepartmentPositionCostDaoInf{
	
	/* (non-Javadoc)
	 * @see s47.dqj.dao.DepartmentPositionCostDaoInf#setSupperSessionFactory(org.hibernate.SessionFactory)
	 */
	@Override
	@Resource(name="sessionFactory")
	public void setSupperSessionFactory(SessionFactory sessionFactory){
		super.setSessionFactory(sessionFactory);
	}
	
	/* (non-Javadoc)
	 * @see s47.dqj.dao.DepartmentPositionCostDaoInf#save(s47.dqj.bean.DepartmentPositionCost)
	 */
	@Override
	public void save(DepartmentPositionCost departmentPositionCost){
		getHibernateTemplate().save(departmentPositionCost);
	}
	
	/* (non-Javadoc)
	 * @see s47.dqj.dao.DepartmentPositionCostDaoInf#update(s47.dqj.bean.DepartmentPositionCost)
	 */
	@Override
	public void update(DepartmentPositionCost departmentPositionCost){
		getHibernateTemplate().update(departmentPositionCost);
	}
	
	/* (non-Javadoc)
	 * @see s47.dqj.dao.DepartmentPositionCostDaoInf#findAll()
	 */
	@Override
	public List<DepartmentPositionCost> findAll(){
		String hql="from DepartmentPositionCost";
		return getHibernateTemplate().find(hql);
	}
	
}
